package com.roncoo.order.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.roncoo.order.entity.EduWithdrawals;
import com.roncoo.order.service.impl.EduWithdrawalsServiceImpl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yuechuanhao
 * @since 2021-04-10
 */
@RestController
@RequestMapping("/edu-withdrawals/")
public class EduWithdrawalsController {

    @Resource
    private EduWithdrawalsServiceImpl eduWithdrawalsService;

    //提款信息
    @PostMapping("findAllById")
    public IPage<List<Map>> findAllById(EduWithdrawals eduWithdrawals, Page page){
        return eduWithdrawalsService.findAllById(eduWithdrawals.getLecturerId(),page);
    }

    @PostMapping("AddById")
    public boolean AddById(EduWithdrawals eduWithdrawals){
        return eduWithdrawalsService.save(eduWithdrawals);
    }

    //收入 AllMoney 还剩多少没提现 TiMoney
    @GetMapping("money")
    public Map money(String id){
        return eduWithdrawalsService.money(id);
    }
}

